package mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import pojo.News;



import java.util.List;

public interface NewsMapper {
    int Newsinsert(News news);

    List<News> NewsSelect();
    List<News> NewsSelectByV();

    List<News> NewsSelectBytime();
    void Newsdelete(int id);

    void deleteByids(@Param("ids") int[] ids);

    int NewsUpdate(News news);

    List<News> selectByPageAndCondition(@Param("begin") int begin, @Param("size")  int size, @Param("news") News news);

    int selectCountByCondition(News news);

    @Select("select * from news where id=#{id}")
    News selectById(int id);

    @Update("update news set view_count=#{view_count} where id=#{id}")
    void addup(@Param("id") int id,@Param("view_count") int view_count);
}
